<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="order/include :: header"></head>

<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
					    <div class="columns pull-right" role="group">
							<button class="btn btn-success" id="daYin" onclick="daY()">
								<i class="fa fa-print" aria-hidden="true"></i>打印
							</button>
						</div>
						<div class="form-horizontal m-t">
							<table class="table table-bordered table-condensed">
								<thead>
								    <tr>
										<th colspan="2">线路门店目录表</th>
									</tr>
									<tr>
										<th style="width: 50%;">线路</th>
										<th>门店</th>
									</tr>
								</thead>
								<tbody>
									<tr th:each="item:${lineDetail.comDetails}">
										<td th:text="${item.carName}"></td>
										<td th:text="${item.midNames}"></td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="ibox-title">
							<h5>线路明细</h5>
						</div>
						<div class="form-horizontal m-t" id="signupForm">
							<table class="table table-bordered table-condensed">
								<tbody>
								<tr>
									<th class="required" style="width: 15%;">商品名称:</th>
									<td th:text="${lineDetail.productName}" colspan="3" style="width: 80%;"></td>
								</tr>
								<tr>
									<th class="required">规格:</th>
									<td th:text="${lineDetail.specTitle}"></td>
									<th class="required" >总数量:</th>
									<td th:text="${lineDetail.factNum}" style="width: 30%;"></td>
								</tr>
								<tr>
									<th class="required">生成时间:</th>
									<td th:text="${#dates.format(lineDetail.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
									<th class="required">分拣员:</th>
									<td></td>
								</tr>
								</tbody>
							</table>
						</div>
						<div class="form-horizontal m-t">
						    <div style="float: left; width: 25%">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th style="width: 70%;">线路</th>
										<th style="width: 30%;">数量</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item, nodirectRecord:${lineDetail.nodirectRecords}" th:if="(${nodirectRecord.count}+3)%4=='0'">
									<td th:text="${item.carName}"></td>
									<td th:text="${item.factNum}"></td>
								</tr>
								</tbody>
							</table>
							</div>
							<div style="float: left; width: 25%">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th style="width: 70%;">线路</th>
										<th style="width: 30%;">数量</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item, nodirectRecord:${lineDetail.nodirectRecords}" th:if="(${nodirectRecord.count}+2)%4=='0'">
									<td th:text="${item.carName}"></td>
									<td th:text="${item.factNum}"></td>
								</tr>
								</tbody>
							</table>
							</div>
							<div style="float: left; width: 25%">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th style="width: 70%;">线路</th>
										<th style="width: 30%;">数量</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item, nodirectRecord:${lineDetail.nodirectRecords}" th:if="(${nodirectRecord.count}+1)%4=='0'">
									<td th:text="${item.carName}"></td>
									<td th:text="${item.factNum}"></td>
								</tr>
								</tbody>
							</table>
							</div>
							<div style="float: right; width: 25%">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th style="width: 70%;">线路</th>
										<th style="width: 30%;">数量</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item, nodirectRecord:${lineDetail.nodirectRecords}" th:if="${nodirectRecord.count}%4=='0'">
									<td th:text="${item.carName}"></td>
									<td th:text="${item.factNum}"></td>
								</tr>
								</tbody>
							</table>
							</div>
							<table>

							</table>
							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<div class="btn btn-danger" onclick="closeDow()" id="gBi"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="order/include::footer"></div>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}
		
		function daY() {
			if(confirm('确认打印吗？')){
			   document.getElementById('daYin').style.display="none";//隐藏打印按钮
			   document.getElementById('gBi').style.display="none";//隐藏关闭按钮
			   window.print();//打印
			   document.getElementById('daYin').style.display="inline";//打印完后显示打印按钮
			   document.getElementById('gBi').style.display="inline";//打印完后显示关闭按钮
			}
		}
	</script>
</body>
</html>
